package com.ytjj.common.configuration;

import com.ytjj.common.constants.OSSClientConstants;
import com.ytjj.common.utils.AliyunOSSClientUtil;
import com.ytjj.common.utils.EveryDayIncrementVarUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 自动装配
 *
 *
 *
 */
@Configuration
@EnableConfigurationProperties(OSSClientConstants.class)
public class AliyunAutoConfiguration {

    @Autowired
    OSSClientConstants ossEntity;

    /**
     * oss组件
     *
     * @return AliyunOSSUtil
     */
    @Bean
    public AliyunOSSClientUtil aliyunOSSUtil() {
        AliyunOSSClientUtil aliyunOSSUtil = new AliyunOSSClientUtil();
        aliyunOSSUtil.setOssEntity(ossEntity);
        return aliyunOSSUtil;
    }

    @Bean
    public EveryDayIncrementVarUtil everyDayIncrementVarUtil() {
        EveryDayIncrementVarUtil everyDayIncrementVarUtil = new EveryDayIncrementVarUtil();
        return everyDayIncrementVarUtil;
    }

}
